const exprress = require('express')
const router = exprress.Router()
const handler = require('../RouterHandler/store.js')
//根据用户获取店铺信息
router.get('/store/getUseridStoreInfo', handler.getUseridStoreInfo)
//新增店铺
router.post('/store/addUseridStoreInfo', handler.addUseridStoreInfo)
//删除店铺
router.delete('/store/delUseridStoreInfo', handler.delUseridStoreInfo)
//修改店铺信息
router.post('/store/updateUseridStoreInfo', handler.updateUseridStoreInfo)
//根据店铺id新增商品
router.post('/store/setGoodsByStoreid', handler.setGoodsByStoreid)
//根据店铺id修改商品
router.post('/store/updateGoodsByStoreid', handler.updateGoodsByStoreid)
//根据店铺id获取商品列表
router.get('/store/getGoodsListByStoreid', handler.getGoodsListByStoreid)
router.get('/store/getGoodListAttr', handler.getGoodListAttr)
router.delete('/store/delCoodsSkuById', handler.delCoodsSkuById)
//删除商品
router.delete('/store/delGoodsByStoreid', handler.delGoodsByStoreid)

//生成订单
router.post('/order/generateOrder', handler.generateOrder)
//获取订单详情
router.get('/order/getOrderDetail', handler.getOrderDetail)
//修改订单信息
router.post('/order/setOrderDetail', handler.setOrderDetail)
//加入购物车
router.post('/order/joinShoppingCart', handler.joinShoppingCart)
//购物车列表
router.get('/order/getShoppingCart', handler.getShoppingCart)
//余额支付
router.post('/order/orderPay', handler.orderPay)
//获取订单列表
router.get('/order/getOrderList', handler.getOrderList)

// 地址相关
router.delete('/store/delUserAddress', handler.delUserAddress)
router.post('/store/getUserAddress', handler.getUserAddress)
router.post('/store/addUserAddress', handler.addUserAddress)
router.post('/store/updateUserAddress', handler.updateUserAddress)
module.exports = router